<?php
/**
 * Object Relational Persistence Mapping Class for table: rhm_odontologist_emr
 *
 * @package	modules.dept_pharmacy.ordo
 * @author	viethd
 * @version $
 * @copyright 2009 LHV Company
 */
class RhmOdontologistEmr extends ORDataObject {

    /**#@+
     * Fields of table: rhm_odontologist_emr mapped to class members
     */
    var $rhm_odontologist_emr_id		= '';
    var $medical_record_id		= '';
    var $start_date		= '';
    var $reason		= '';
    var $medical_history		= '';
    var $ttsk_ha		= '';
    var $ttsk_ha_checked		= '';
    var $ttsk_td		= '';
    var $ttsk_td_checked		= '';
    var $ttsk_btm		= '';
    var $ttsk_btm_checked		= '';
    var $ttsk_cml		= '';
    var $ttsk_cml_checked		= '';
    var $ttsk_bg		= '';
    var $ttsk_bg_checked		= '';
    var $ttsk_dut		= '';
    var $ttsk_dut_checked		= '';
    var $ttsk_btk		= '';
    var $ttsk_btk_checked		= '';
    var $ttsk_bp		= '';
    var $ttsk_bp_checked		= '';
    var $ttsk_tkn		= '';
    var $ttsk_tkn_checked		= '';
    var $ttsk_bddt		= '';
    var $ttsk_kcky		= '';
    var $cls_xq		= '';
    var $cls_xq_checked		= '';
    var $cls_xn		= '';
    var $cls_xn_checked		= '';
    var $cls_k		= '';
    var $cls_k_checked		= '';
    var $khdt_1		= '';

    var $khdt_2		= '';

    var $khdt_3		= '';

    var $khdt_4		= '';

    var $khdt_5		= '';

    var $khdt_6		= '';

    var $khdt_7		= '';

    var $khdt_8		= '';

    var $khdt_9		= '';

    var $kham_ngoai_mat		= '';
    var $kham_trong_mieng     = '';
    var $chuan_doan		= '';
    var $icd10_chinh_id		= '';
    var $icd10_phu_id		= '';
    var $doctor_id		= '';
    var $ttsk_bddt_checked = '';
    var $ttsk_kcky_checked = '';
    /**#@-*/


    /**
     * DB Table
     */
    var $_table = 'rhm_odontologist_emr';

    /**
     * Primary Key
     */
    var $_key = 'rhm_odontologist_emr_id';

    /**
     * Internal Name
     */
    var $_internalName = 'RhmOdontologistEmr';

    /**
     * Handle instantiation
     */
    function __construct() {
        parent::ORDataObject();
    }
    public function setData($data = array()) {
        if (is_array($data)) {
            $this->populateArray($data);
        }
    }
    public function loadProfile($recordId) {
        $ds =& new Datasource_sql();
        $sql = array(
            'cols'  => "rhm_odontologist_emr_id",
            'from'  => "$this->_table",            
            'where' => "medical_record_id='$recordId'"
        );
        $ds->setup($this->_db, $sql);
        $result = $ds->toArray();

        if (!empty($result)) {
            $this->setup($result[0]['rhm_odontologist_emr_id']);
        }
        
        return $this;        
    }
}
?>
